home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 585 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.2 KB

  1. Path: news.clark.net!not-for-mail
  2. From: eamick@clark.net (Eric Amick)
  3. Newsgroups: comp.std.c
  4. Subject: Re: Bit-field sizes
  5. Date: 18 Mar 1996 02:06:01 GMT
  6. Organization: the end of my rope
  7. Distribution: world
  8. Message-ID: <4iige9$5g@clarknet.clark.net>
  9. References: <nzRPxQ9ytZZA084yn@csn.net> <4hkgds$bbh@info1.sdrc.com> <4ho846$g2d@usenet.pa.dec.com> <4hpkcv$gjc@info1.sdrc.com> <827022001snz@genesis.demon.co.uk>
  10. NNTP-Posting-Host: explorer.clark.net
  11. Mime-Version: 1.0
  12. Content-Type: TEXT/PLAIN; charset=ISO-8859-1
  13. Content-Transfer-Encoding: 8bit
  14. X-Newsreader: TIN [UNIX 1.3 950726BETA PL0]
  15.  
  16. Lawrence Kirby (fred@genesis.demon.co.uk) wrote:
  17. >There is a curious case here however. Lets say (with reference to 6.5.2.1)
  18. >I declare:
  19. >
  20. >struct bit {
  21. >    long field : CHAR_BIT*sizeof(long) + 1;
  22. >};
  23. >
  24. >This results in undefined behaviour due to the long type of the declarator.
  25. >However a constraint is also violated due to the field width. Is a diagnostic
  26. >still required in this case or can the compiler omit it as a form of undefined
  27. >behaviour?
  28.  
  29. TC1 requires all constraint violations to be diagnosed, even if undefined
  30. behavior is involved. 
  31.  
  32. -- 
  33. Eric Amick            eamick@clark.net
  34. Columbia, MD            Public key available via finger
  35.